home *** CD-ROM | disk | FTP | other *** search
/ Disc to the Future 2 / Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin / MAC / HYPERCAR / XCMDS_&_ / JORGENSE / CHOOSERN.C next >
C/C++ Source or Header  |  1988-10-12  |  967b  |  36 lines

  1. /*
  2.     chooserName -- sample XFCN to return the chooser name
  3.     10 Oct 1988 Greg Jorgensen, Mac DTS
  4.     ⌐ Apple Computer Inc., 1988
  5.     
  6.     Gets the chooser name from the System file STR -16096 resource
  7.     
  8.     THIS CODE IS NOT SUPPORTED BY APPLE COMPUTER
  9.     It may not work with future releases.
  10.     May be distributed free of charge.
  11. */
  12.  
  13. #include <HyperXCmd.h>
  14.  
  15. /* **** WARNING:  DO NOT USE GLOBAL VARIABLES! **** */
  16.  
  17. pascal void main(paramPtr)
  18.     XCmdBlockPtr    paramPtr;
  19. {
  20.     int    saveResFile;
  21.     Handle theHndl;
  22.  
  23.     saveResFile = CurResFile();                /* save the current res file id */
  24.     UseResFile(0);                            /* point to System file */
  25.     theHndl = GetResource('STR ', -16096);    /* get the resource */
  26.     if (theHndl) {
  27.         DetachResource(theHndl);            /* take resource from resource mgr */
  28.         PtoCstr(*theHndl);                    /* change to C-string in place */
  29.     }
  30.     UseResFile(saveResFile);                /* reset to saved res file */
  31.     paramPtr->returnValue = theHndl;        /* stuff result for Hypercard */
  32. }
  33.  
  34. #include "XCmdGlue.inc.c"
  35.  
  36.